package com.sztz.batch;

import cn.hutool.core.exceptions.ExceptionUtil;
import com.sztz.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.ItemReadListener;

/**
 * 数据读取监听器
 * @author yzy
 * @date 2022/8/17 15:25
 */
@Slf4j
public class MyReadListener implements ItemReadListener<User> {
    @Override
    public void beforeRead() {}

    @Override
    public void afterRead(User item) {}

    @Override
    public void onReadError(Exception ex) {
        log.info("读取数据出现异常 = {}",ExceptionUtil.stacktraceToString(ex));
    }
}
